Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add different i18n path structure #7400

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

offscriptdev
Copy link

@offscriptdev offscriptdev commented Feb 10, 2025

Summary

We have an overall i18n path strategy to place the locale just after the root, and decap does not support this out of the box. To fix this, we added a new structure to i18n.ts.

Basically, Decap supports this site.com/content/locale/slug

But we needed it to support this site.com/locale/content/slug

Test plan

npm run test && npm run format are passing
image

image
...
image

Checklist

Please add a x inside each checkbox:

  • I have read the contribution guidelines.
  • tests updated, performed and passed
  • code linted successfully
  • feature branch rebased before PR

A picture of a cute animal (not mandatory but encouraged)
If you don't approve this PR, Piper will be sad.
image
Do it for Piper :)

@offscriptdev offscriptdev requested a review from a team as a code owner February 10, 2025 22:37
@offscriptdev
Copy link
Author

Hello @martinjagodic, or whoever can answer this for us:

Is there any kind of timeline we can expect for this PR to be reviewed?

Asking because we need to get the url structure working for our site and are facing deadlines. The answer for what we can expect here will help us decide where we should allocate our development resources accordingly.

Thank you in advance!

@martinjagodic
Copy link
Member

@offscriptdev sorry, there is no timeline. We review PRs when we find the time. Currently we have some other PRs in the pipeline to merge, so I can't promise you anything.

If you really need this to happen, you can reach out to [email protected] and we can discuss this as a priority.

@offscriptdev
Copy link
Author

Thanks @martinjagodic for your quick reply. It's very helpful.

@offscriptdev
Copy link
Author

offscriptdev commented Mar 2, 2025

I tried to deploy this myself, and got as far as building the JS for the front-end. Saving the content works as expected with all files being saved in the correct location. However, on refresh, the content disappears from the UI.

I tracked this down to the folder argument passed into allEntriesByFolder method on the implementation type. By default the folder will be /content/blog which gets all locales and then filters them by the default locale. So, all we need to do is pass in the default locale to the folder we're fetching. I got this fixed and working locally for Github, but I see there are other implementations.

I'll see what I can do about patching all the other implementations a little later.

@offscriptdev
Copy link
Author

I've got the UI fetching the content from Gtihub and the local server without issues. I can get a screen recording of my tests if needed, as I didn't see any automated tests covering this.

I'd test other implementations, like Gitlab, but I'm frankly way too busy.

Recent changes from this repo have been merged into my fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants